/*
 * F2.c
 *
 *  Created on: 21/10/2012
 *      Author: Sarah
 */

#include "F2.h"

double F2minX = -5;
double F2maxX = 5;
int F2dimensions = 1000;

double compute(double* x){
  int    i;
  double result;

	double* F2Ovector = createShiftVector(F2dimensions,F2minX,F2maxX);
	double* F2anotherz = malloc(sizeof(double)*F2dimensions);


  for(i = 0; i < F2dimensions; i++) {
	  F2anotherz[i] = x[i] - F2Ovector[i];
  }

  result = rastrigin(F2anotherz,F2dimensions);

  free(F2Ovector);
  free(F2anotherz);

  return(result);
}


int F2GetDimensions() {
	return F2dimensions;
}
double F2GetGetMax() {
	return F2maxX;
}
double F2GetMin() {
	return F2minX;
}
